package com.newlink.building.common_base.activities

import android.content.Context
import android.view.ViewGroup
import com.bumptech.glide.Glide
import com.github.chrisbanes.photoview.PhotoView
import com.newlink.building.common_base.R
import com.newlink.building.common_base.widget.adapter.AppAdapter


class Base_ImagePreviewAdapter constructor(val context: Context) : AppAdapter<String?>(context) {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        return ViewHolder()
    }

    inner class ViewHolder : AppViewHolder(R.layout.image_preview_item) {

        private val photoView: PhotoView by lazy { getItemView() as PhotoView }

        override fun onBindView(position: Int) {
            Glide.with(context)
                .load(getItem(position))
                .into(photoView)
        }
    }
}